package com.ruoyi.system.feign;

import com.ruoyi.system.feign.model.FeignUserModel;
import com.ruoyi.system.feign.result.FeignDataResult;
import com.ruoyi.system.feign.result.FeignObjectResult;
import com.ruoyi.system.feign.result.PageHelper;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(
        name = "userServiceClient",
        url = "${service.openai.url}"
)
public interface UserServiceClient {


    @PostMapping("/admin/user/index")
    @Headers({"Content-Type: application/json"})
    FeignDataResult<FeignUserModel> getUserList(@RequestBody PageHelper<FeignUserModel> pageHelper);

    @PostMapping("/admin/user/save")
    @Headers({"Content-Type: application/json"})
    FeignObjectResult<FeignUserModel> save(@RequestBody FeignUserModel model);

    @GetMapping("/admin/user/delete/{id}")
    @Headers({"Content-Type: application/json"})
    FeignObjectResult<FeignUserModel> delete(@PathVariable(value = "id") String id);

    @PostMapping("/admin/user/update")
    @Headers({"Content-Type: application/json"})
    FeignObjectResult<FeignUserModel> update(@RequestBody FeignUserModel model);

    @GetMapping("/admin/user/detail/{id}")
    @Headers({"Content-Type: application/json"})
    FeignObjectResult<FeignUserModel> detail(@PathVariable(value = "id") String id);
}
